package com.kay.framework.pojo;

import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Pattern;

/**
 * @Description:
 * @Author: Kay
 * @CreateDate: 2021/7/12$ 16:18$
 * @UpdateUser: Kay
 * @UpdateDate: 2021/7/12$ 16:18$
 */
public class Handler {
    private Object controller; // controller对象
    private Method method; // controller下的方法
    private Pattern pattern; // 正则表达式（URL）
    private Map<String, Integer> paramsIndexMapping; // key： 参数名  value : 参数的顺序

    public Handler(Object controller, Method method, Pattern pattern) {
        this.controller = controller;
        this.method = method;
        this.pattern = pattern;
        this.paramsIndexMapping = new HashMap<>();
    }

    public Object getController() {
        return controller;
    }

    public void setController(Object controller) {
        this.controller = controller;
    }

    public Method getMethod() {
        return method;
    }

    public void setMethod(Method method) {
        this.method = method;
    }

    public Pattern getPattern() {
        return pattern;
    }

    public void setPattern(Pattern pattern) {
        this.pattern = pattern;
    }

    public Map<String, Integer> getParamsIndexMapping() {
        return paramsIndexMapping;
    }

    public void setParamsIndexMapping(Map<String, Integer> paramsIndexMapping) {
        this.paramsIndexMapping = paramsIndexMapping;
    }
}
